package com.ukao.cashregister.utils;

import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.ukao.cashregister.R;

/**
 * Created by sunfusheng on 15/8/7.
 */
public class T {

    private static Toast toast;

    public static void show(String message) {
        if (null == toast) {
            toast = Toast.makeText(Utils.getContext(), message, Toast.LENGTH_SHORT);
        }
        toast.setDuration(Toast.LENGTH_SHORT);
        View view = LayoutInflater.from(Utils.getContext()).inflate(R.layout.toast_item_layout,
                null);
        toast.setView(view);
        TextView textView = (TextView) view.findViewById(R.id.tv_toast);
        textView.setText(message);
        toast.setGravity(Gravity.CENTER,0,0);
        toast.show();
    }



}
